Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with empty initialize_params block #664

Merged
merged 2 commits into from
Nov 3, 2017

Conversation

danawillow
Copy link
Contributor

In old versions of Terraform, disk.size was being set to "0" in state for disks that did not specify a size parameter. Check for this case when checking that the field is empty, and fix states that accidentally added an initialize_params block to the boot_disk during the migration in the above scenario.

Part of #658.

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 comment that may not be necessary, and looks good to me.

is.Attributes["boot_disk.0.initialize_params.0.size"] == "") &&
is.Attributes["boot_disk.0.initialize_params.0.type"] == "" &&
is.Attributes["boot_disk.0.initialize_params.0.image"] == "" {
is.Attributes["boot_disk.0.initialize_params.#"] = "0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth calling delete(is.Attributes, "boot_disk.0.initialize_params.INSERT_EVERY_ATTRIBUTE_HERE") to get a properly clean state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, can't hurt. Done.

@paddycarver
Copy link
Contributor

👍 LGTM

@danawillow danawillow merged commit f68765f into hashicorp:master Nov 3, 2017
@danawillow danawillow deleted the is-658 branch November 3, 2017 22:25
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants